<?php

namespace common\models\Percentage;

use Yii;

/**
 * This is the model class for table "percentage".
 *
 * @property string $id
 * @property string $plug_id
 * @property string $upper_num 总终端数
 * @property string $real_num 实际终端数 手动填写修改
 * @property string $created_date
 * @property int $status 是否分成
 */
class PercentageBase extends \common\models\CommonModel\CommonModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'percentage';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['plug_id', 'upper_num', 'real_num', 'created_date'], 'required'],
            [['plug_id', 'upper_num', 'real_num', 'status'], 'integer'],
            [['created_date'], 'safe'],
            [['plug_id', 'created_date'], 'unique', 'targetAttribute' => ['plug_id', 'created_date']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'plug_id' => 'Plug ID',
            'upper_num' => 'Upper Num',
            'real_num' => 'Real Num',
            'created_date' => 'Created Date',
            'status' => 'Status',
        ];
    }
}
